<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <canvas id="canvas" width="600" height="600" style="box-shadow: 0 0 10px #000;"></canvas>
</body>

</html>


<script>
  var canvas = document.getElementById('canvas')
  var ctx = canvas.getContext('2d')

  ctx.fillStyle = 'hotpink'
  ctx.fillRect(20, 20, 200, 50)

  ctx.fillStyle = 'skyblue'
  ctx.translate(210, 0)
  ctx.fillRect(20, 20, 200, 50)
</script>